package com.qf.service.impl;

import com.qf.dao.UserDao;
import com.qf.pojo.User;
import com.qf.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

/**
 * @author lwc
 * @date 2021/10/26 20:59
 * @Description
 */

@Service("userService")
public class UserServiceImpl  implements UserService {
    @Autowired
    @Qualifier("userDaoImpl2")
    private UserDao userDao;


    @Value("abc")
    private String name;

    @Autowired
    private User user;


    @Override
    public void save() {
        System.out.println("userService的添加方法");

        userDao.save();
    }
    @PostConstruct
    public void init(){
        System.out.println("userService中注入的userDao:"+userDao);
        System.out.println(user);
    }

}

